#pragma once

class CTabBase
{
public:
	CTabBase();
	void AddItem(int Index,CWnd* BindWnd);
	int GetItemCount();
	CWnd*& GetItem(int Index);
	int GetCurSel();
	int SetCurSel(int Index);
private:
	vector<CWnd*> m_vctItem;
	int m_CurSel;
	CWnd* m_NullWnd;
	//int m_LastSel;
};

class CTabCtrlEz : public CTabCtrl,public CTabBase
{
	DECLARE_DYNAMIC(CTabCtrlEz)

public:
	CTabCtrlEz();
	~CTabCtrlEz();

public:
	virtual void OnDraw(CDC* pDC,CRect* Rect){};

	int ConstructView(CWnd* Parent,CRect* Rect=0,DWORD Style=0);
	int AddTab(LPCWSTR Caption,CWnd* BindWnd);
	int GetCurSel();
	int SetCurSel(int nItem);
	int GetItemCount();
	CWnd* GetItem(int Index);
public:
	//vector<CWnd*> m_vctContent;
	int m_ID;

	DECLARE_MESSAGE_MAP()
public:
	virtual afx_msg void OnSelChange(NMHDR * pNotifyStruct, LRESULT* result);

	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnPaint();
};


